﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using GestionadorBaseDatos;
/// <summary>
/// Descripción breve de tabla fefefe
/// </summary>
public class tabla
{
    public static HtmlTable ConsultarCategorias(IList categoria)
    {
 HtmlTable table = new HtmlTable();
        HtmlTableRow row = new HtmlTableRow();
        HtmlTableCell cell = new HtmlTableCell();



        HtmlTable tableCategoria = new HtmlTable();
        HtmlTableRow r = new HtmlTableRow();
        HtmlTableCell cat = new HtmlTableCell();


        cat.Controls.Add(new LiteralControl("<b>Nombre Producto</b>"));
        cat.Align = "center";

        r.Cells.Add(cat);

        r.BgColor = "#8EA7E2";

        tableCategoria.Rows.Add(r);


       

        Label categ = new Label();
        categ.Font.Bold = false;
        categ.Font.Name = "Verdana";
        categ.Font.Size = new FontUnit(10);


        int tam = categoria.Count;
        int cont = 0;

        while (cont < tam)
        {
            r = new HtmlTableRow();
            cat = new HtmlTableCell();
            categ.Text = "* " + ((Categoria)categoria[cont]).Nombre + "\n\r";
            cat.Controls.Add(categ);
            r.Cells.Add(cat);
            tableCategoria.Rows.Add(r);
            
              cont++;
        }
   
      
        return tableCategoria;
    
    }
    public tabla()
    {
        //
        // TODO: Agregar aquí la lógica del constructor
        //
    }
}
